The network class is at the heart of the network implementation and provides the core functions.

Ejemplo n.º 1
0
 void SendEchoConsole(Network.Connection cn, string msg)
 {
     if (Network.Net.sv.IsConnected())
     {
         Network.Net.sv.write.Start();
         Network.Net.sv.write.PacketID(Network.Message.Type.ConsoleMessage);
         Network.Net.sv.write.String(msg);
         Network.Net.sv.write.Send(new Network.SendInfo(cn));
     }
 }
Ejemplo n.º 2
0
 private void CanClientLogin(Network.Connection connection)
 {
     HookCalled("CanClientLogin");
 }
Ejemplo n.º 3
0
 public static void OnRemoteAction(Network.UserUI ui)
 {
     Log.debug("UserUI: {0}",ui);
     if (ui != null) Log.debug("UserUI.emoteInfo: {0}",ui.emoteInfo);
     if (ui != null && ui.emoteInfo != null) Log.debug("Emote: {0}",ui.emoteInfo.Emote);
     if (Instance.eventListener != null)
     {
         if (ui != null && ui.emoteInfo != null) Instance.eventListener.notifyEvent(new Message("emoteInfo", ui.emoteInfo));            
     }
 }
Ejemplo n.º 4
0
 private void OnUserApprove(Network.Connection connection)
 {
     HookCalled("OnUserApprove");
 }
Ejemplo n.º 5
0
 private void OnPlayerConnected(Network.Message packet)
 {
     HookCalled("OnPlayerConnected");
     // TODO: Print player connected
 }
Ejemplo n.º 6
0
 private void OnPlayerConnected(Network.Message packet)
 {
     HookCalled("OnPlayerConnected");
     Puts($"{packet.connection.username} ({packet.connection.userid}) connected!");
 }
Ejemplo n.º 7
0
 public void Init()
 {
     testNetworkObject = GameObject.Instantiate(AssetDatabase.LoadAssetAtPath ("Assets/Prefabs/Network.prefab", typeof(GameObject)), Vector3.zero, Quaternion.identity) as GameObject;
     testNetwork = testNetworkObject.GetComponent<Network> ();
     testNetworkProbe = new Probe<Network> (testNetwork);
 }
Ejemplo n.º 8
0
 public void Init()
 {
     testNetworkObject = GameObject.Instantiate(AssetDatabase.LoadAssetAtPath ("Assets/Prefabs/Network.prefab", typeof(GameObject)), Vector3.zero, Quaternion.identity) as GameObject;
     testNetwork = testNetworkObject.GetComponent<Network> ();
     testNetworkProbe = new Probe<Network> (testNetwork);
     testNetwork.initialize (3, 3);
     map = testNetworkProbe.getField ("networkMap") as NodeController[,];
 }