internal void OnPlayerJoin(RoomPlayer newPlayer) { newPlayer.Session = null; newPlayer.Room = this.Room; this.Room.Players.Add(newPlayer.Id, newPlayer); this.RoomClient.Callback.OnPlayerJoin(newPlayer); }
static void Register() { SerializableTypeRegister.RegisterType(typeof(Vector3), (byte)SerilizeType.Vector3, Vector3SerializeFunction, Vector3DeserializeFunction); SerializableTypeRegister.RegisterType(typeof(Vector2), (byte)SerilizeType.Vector2, Vector2SerializeFunction, Vector2DeserializeFunction); SerializableTypeRegister.RegisterType(typeof(Quaternion), (byte)SerilizeType.Quaternion, QuaternionSerializeFunction, QuaternionDeserializeFunction); SerializableTypeRegister.RegisterType(typeof(HostPort), (byte)SerilizeType.HostPort, (stream, customObject) => { HostPort obj = (HostPort)customObject; obj.Serilize(stream); }, stream => { HostPort ret = new HostPort(); ret.Deserilize(stream); return(ret); }); SerializableTypeRegister.RegisterType(typeof(LobbyRoom), (int)SerilizeType.LobbyRoom, (stream, customObject) => { LobbyRoom obj = (LobbyRoom)customObject; obj.Serilize(stream); }, stream => { LobbyRoom ret = new LobbyRoom(); ret.Deserilize(stream); return(ret); }); SerializableTypeRegister.RegisterType(typeof(GameRoom), (int)SerilizeType.GameRoom, (stream, customObject) => { GameRoom obj = (GameRoom)customObject; obj.Serilize(stream); }, stream => { GameRoom ret = new GameRoom(); ret.Deserilize(stream); return(ret); }); SerializableTypeRegister.RegisterType(typeof(RoomPlayer), (int)SerilizeType.Player, (stream, customObject) => { RoomPlayer obj = (RoomPlayer)customObject; obj.Serilize(stream); }, stream => { RoomPlayer ret = new RoomPlayer(); ret.Deserilize(stream); return(ret); }); }
public virtual void OnPlayerPropertiesChanged(RoomPlayer player, Dictionary <object, object> changedPart) { }
public virtual void OnMasterClientSwitched(RoomPlayer newMasterClient) { }
public virtual void OnPlayerLeave(RoomPlayer otherPlayer) { }
public virtual void OnPlayerJoin(RoomPlayer newPlayer) { }