protected void Awake() { if (instance != null && instance != this) { Destroy(gameObject); return; } instance = this; w = new NetWriter(); NetLogFilter.CurrentLogLevel = (int)logLevel; NetLogFilter.spew = debugSpew; NetLogFilter.messageDiagnostics = messageDiagnostics; Application.targetFrameRate = serverUpdateRate; QualitySettings.vSyncCount = 0; connectedPeers = new Dictionary <int, Peer>(); this.modules = new Dictionary <Type, ServerModule>(); initializedModules = new HashSet <Type>(); handlers = new Dictionary <short, PacketHandler>(); isInitialized = false; var modules = GetComponentsInChildren <ServerModule>(); foreach (var mod in modules) { AddModule(mod); } DontDestroyOnLoad(gameObject); }
public void Serialize(NetWriter writer) { writer.WritePackedUInt64(identity); }
public static void CreateAndFinalize(NetWriter w, short opCode, ISerializablePacket packet /*, int responseID = -1, bool comepleteResponse = false, ResponseStatus status = ResponseStatus.Default*/) { w.Write(opCode); packet.Serialize(w); }
public void Serialize(NetWriter w) { w.Write(Command); w.WriteBytesAndSizeSegment(data); }
public void Serialize(NetWriter w) { w.WritePackedUInt64(id); w.Write(flag); }
public void Serialize(NetWriter writer) { writer.Write(lastPingPacketTime); }
public void Serialize(NetWriter writer) { writer.Write(clientTime); writer.Write(serverTime); }
public void Serialize(NetWriter writer) { }