public static GameRoomView Deserialize(Stream bytes) { int mask = Int32Proxy.Deserialize(bytes); var view = new GameRoomView(); view.MapId = Int32Proxy.Deserialize(bytes); view.Number = Int32Proxy.Deserialize(bytes); if ((mask & 1) != 0) { view.Server = ConnectionAddressViewProxy.Deserialize(bytes); } return(view); }
public static GameRoomDataView Deserialize(Stream bytes) { int mask = Int32Proxy.Deserialize(bytes); var view = new GameRoomDataView(); view.ConnectedPlayers = Int32Proxy.Deserialize(bytes); view.GameFlags = Int32Proxy.Deserialize(bytes); view.GameMode = EnumProxy <GameModeType> .Deserialize(bytes); if ((mask & 1) != 0) { view.Guid = StringProxy.Deserialize(bytes); } view.IsPasswordProtected = BooleanProxy.Deserialize(bytes); view.IsPermanentGame = BooleanProxy.Deserialize(bytes); view.KillLimit = Int32Proxy.Deserialize(bytes); view.LevelMax = ByteProxy.Deserialize(bytes); view.LevelMin = ByteProxy.Deserialize(bytes); view.MapID = Int32Proxy.Deserialize(bytes); if ((mask & 2) != 0) { view.Name = StringProxy.Deserialize(bytes); } view.Number = Int32Proxy.Deserialize(bytes); view.PlayerLimit = Int32Proxy.Deserialize(bytes); if ((mask & 4) != 0) { view.Server = ConnectionAddressViewProxy.Deserialize(bytes); } view.TimeLimit = Int32Proxy.Deserialize(bytes); return(view); }