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