1
This commit is contained in:
parent
97992f176e
commit
31f14dd2e5
@ -1,7 +1,7 @@
|
|||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
import traceback
|
import traceback
|
||||||
|
import glm
|
||||||
|
|
||||||
import cs_proto_pb2
|
import cs_proto_pb2
|
||||||
import cs_msgid_pb2
|
import cs_msgid_pb2
|
||||||
@ -26,10 +26,14 @@ kPropCarOil = 27
|
|||||||
kPropFollowTarget = 30
|
kPropFollowTarget = 30
|
||||||
kPropDive = 31
|
kPropDive = 31
|
||||||
|
|
||||||
|
kGasInactive = 0
|
||||||
|
kGasWaiting = 1
|
||||||
|
kGasMoving = 2
|
||||||
|
kGasJump = 3
|
||||||
|
|
||||||
class Simulate(object):
|
class Simulate(object):
|
||||||
|
|
||||||
def __init__(self, joined_msg, mapinfo_msg):
|
def __init__(self, joined_msg, mapinfo_msg):
|
||||||
|
|
||||||
self._joined_msg = joined_msg
|
self._joined_msg = joined_msg
|
||||||
self._mapinfo_msg = mapinfo_msg
|
self._mapinfo_msg = mapinfo_msg
|
||||||
self._curr_player = {
|
self._curr_player = {
|
||||||
@ -41,7 +45,8 @@ class Simulate(object):
|
|||||||
'inventory': [],
|
'inventory': [],
|
||||||
'cur_weapon_idx': 0,
|
'cur_weapon_idx': 0,
|
||||||
'weapons': [],
|
'weapons': [],
|
||||||
'skill_list': []
|
'skill_list': [],
|
||||||
|
'netdata': None
|
||||||
}
|
}
|
||||||
self._frames = []
|
self._frames = []
|
||||||
self._curr_frameno = 0
|
self._curr_frameno = 0
|
||||||
@ -56,10 +61,7 @@ class Simulate(object):
|
|||||||
self._updateFrame(self._frames[i])
|
self._updateFrame(self._frames[i])
|
||||||
i += 1
|
i += 1
|
||||||
self._frames = []
|
self._frames = []
|
||||||
self._cmmove()
|
self._thinking()
|
||||||
|
|
||||||
def _cmmove(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def _updateFrame(self, frame):
|
def _updateFrame(self, frame):
|
||||||
self._curr_frameno = frame.frameno
|
self._curr_frameno = frame.frameno
|
||||||
@ -134,9 +136,11 @@ class Simulate(object):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def _updatePartObj(self, obj):
|
def _updatePartObj(self, obj):
|
||||||
entity = self._objHash[obj.obj_uniid]
|
e = self._objHash[obj.obj_uniid]
|
||||||
entity.pos.x = 100
|
e.pos.x = obj.pos.x
|
||||||
#entity.dir = obj.dir
|
e.pos.y = obj.pos.y
|
||||||
|
e.dir.x = obj.dir.x
|
||||||
|
e.dir.y = obj.dir.y
|
||||||
|
|
||||||
def _updateActivePlayerData(self, frame):
|
def _updateActivePlayerData(self, frame):
|
||||||
if not frame.active_player_data:
|
if not frame.active_player_data:
|
||||||
@ -223,3 +227,13 @@ class Simulate(object):
|
|||||||
pass
|
pass
|
||||||
elif prop.property_type == kPropDive:
|
elif prop.property_type == kPropDive:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def _thinking(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _myself(self):
|
||||||
|
return self._objHash[self._mapinfo_msg.player_id]
|
||||||
|
|
||||||
|
def _activePlayer(self):
|
||||||
|
self._curr_player['netdata'] = self._objHash[self._curr_player['obj_id']]
|
||||||
|
return self._curr_player
|
||||||
|
Loading…
x
Reference in New Issue
Block a user