示例#1
0
 internal void OnPlayerJoin(RoomPlayer newPlayer)
 {
     newPlayer.Session = null;
     newPlayer.Room    = this.Room;
     this.Room.Players.Add(newPlayer.Id, newPlayer);
     this.RoomClient.Callback.OnPlayerJoin(newPlayer);
 }
示例#2
0
        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);
            });
        }
示例#3
0
 public virtual void OnPlayerPropertiesChanged(RoomPlayer player, Dictionary <object, object> changedPart)
 {
 }
示例#4
0
 public virtual void OnMasterClientSwitched(RoomPlayer newMasterClient)
 {
 }
示例#5
0
 public virtual void OnPlayerLeave(RoomPlayer otherPlayer)
 {
 }
示例#6
0
 public virtual void OnPlayerJoin(RoomPlayer newPlayer)
 {
 }