コード例 #1
0
 public void OnServerRegistration(string nickname, string message)
 {
     LogFile.WriteLine("serverregistration. received from " + nickname + ": " + message);
     if (message.StartsWith("QUERY"))
     {
         SendCommand(nickname, new XmlCommands.ServerInfo(
                         externaladdress, externalport));
     }
     else
     {
         try
         {
             XmlCommands.Command command = XmlCommands.GetInstance().Decode(message);
             if (command.GetType() == typeof(XmlCommands.PingMe))
             {
                 XmlCommands.PingMe pingmecommand = command as XmlCommands.PingMe;
                 LogFile.WriteLine("serverregistration received pingme command: " + new IPAddress(pingmecommand.MyIPAddress) +
                                   " " + pingmecommand.Myport);
                 IPEndPoint endpoint = new IPEndPoint(new IPAddress(pingmecommand.MyIPAddress), pingmecommand.Myport);
                 MetaverseServer.GetInstance().network.networkimplementation.Send(endpoint, new byte[] { 0 });
             }
         }
         catch (Exception ex)
         {
             LogFile.WriteLine(ex);
         }
     }
 }
コード例 #2
0
ファイル: ServerInfo.cs プロジェクト: beyonddiana/osmp-cs
 ServerInfo()
 {
     if (MetaverseServer.GetInstance().Running)
     {
         ContextMenuController.GetInstance().RegisterPersistentContextMenu(new string[] { "Network", "&Server Info..." }, new ContextMenuHandler(ServerInfoDialog));
         //ContextMenuController.GetInstance().RegisterPersistentContextMenu( new string[] { "Network", "&Private server Info..." }, new ContextMenuHandler( PrivateServerInfoDialog ) );
         MetaverseClient.GetInstance().Tick += new MetaverseClient.TickHandler(ServerInfo_Tick);
     }
 }
コード例 #3
0
        void ServernameCallback(string servername)
        {
            if (servername == "")
            {
                return;
            }

            ircname = "srv_" + servername;

            LogFile.WriteLine(this.GetType() + " ircname will be: " + ircname + " calling STUN...");
            STUN stun = new STUN(MetaverseServer.GetInstance().network.networkimplementation, new STUN.GotExternalAddress(GotExternalAddress));
        }
コード例 #4
0
        ServerRegistration() // protected to enforce singleton
        {
            coordinationconfig = Config.GetInstance().coordination;

            chat = ChatImplementationFactory.CreateInstance();
            MetaverseServer.GetInstance().Tick += new MetaverseServer.TickHandler(chat.Tick);


            chat.IMReceived += new IMReceivedHandler(this.OnRecieveMessage);

            new InputBox("Please enter a worldname to publish your server to " + coordinationconfig.ircserver +
                         " irc " + coordinationconfig.ircchannel, new InputBox.Callback(ServernameCallback));
        }
コード例 #5
0
 public void MarkAllDirty()
 {
     LogFile.WriteLine("MarkAllDirty() client " + connection);
     // note to self: this is a hack
     foreach (IHasReference entity in MetaverseServer.GetInstance().World.entities)
     {
         if (!DirtyAttributesByEntity.ContainsKey(entity))
         {
             LogFile.WriteLine("Marking dirty " + entity.GetType().ToString() + " " + entity.Reference);
             DirtyAttributesByEntity.Add(entity, new List <Type>());
         }
         if (!DirtyAttributesByEntity[entity].Contains(typeof(Replicate)))
         {
             DirtyAttributesByEntity[entity].Add(typeof(Replicate));
         }
     }
 }
コード例 #6
0
ファイル: ServerInfo.cs プロジェクト: beyonddiana/osmp-cs
        void SendPing()
        {
            if (friendipaddressentry.Text == "")
            {
                return;
            }
            int friendport = 1234;

            try
            {
                friendport = Convert.ToInt32(friendportentry.Text);
            }
            catch
            {
            }
            MetaverseServer.GetInstance().PingClient(friendipaddressentry.Text, friendport);
        }
コード例 #7
0
ファイル: ServerInfo.cs プロジェクト: beyonddiana/osmp-cs
        void ServerInfoDialog(object source, ContextMenuArgs e)
        {
            if (serverinfowindow != null)
            {
                serverinfowindow.Destroy();
            }
            Glade.XML app = new Glade.XML(EnvironmentHelper.GetExeDirectory() + "/metaverse.client.glade", "serverinfowindow", "");
            app.Autoconnect(this);

            btnsendping.Clicked += new EventHandler(btnsendping_Clicked);
            //btnholdopen.Pressed += new EventHandler( btnholdopen_Pressed );
            //btnholdopen.Released += new EventHandler( btnholdopen_Released );
            btnclose.Clicked += new EventHandler(btnclose_Clicked);

            localipaddressentry.Text = MetaverseServer.GetInstance().network.networkimplementation.LocalIPAddress.ToString();
            localportentry.Text      = MetaverseServer.GetInstance().ServerPort.ToString();
            STUN stun = new STUN(MetaverseServer.GetInstance().network.networkimplementation, new STUN.GotExternalAddress(STUNResponse));
        }
コード例 #8
0
 public void ResendWorld(IPEndPoint connection)
 {
     MetaverseServer.GetInstance().netreplicationcontroller.dirtyobjectcontroller.ReplicateAll(connection);
 }
コード例 #9
0
 public void RequestResendWorld()
 {
     MetaverseServer.GetInstance().worldreplication.ResendWorld(connection);
 }
コード例 #10
0
 public void ObjectDeleted(int reference, string typename)
 {
     MetaverseServer.GetInstance().netreplicationcontroller.ObjectDeletedRpc(connection,
                                                                             reference, typename);
 }
コード例 #11
0
 public void ObjectModified(int reference, string typename, int attributebitmap, byte[] entity)
 {
     MetaverseServer.GetInstance().netreplicationcontroller.ObjectModifiedRpc(connection,
                                                                              reference, typename, attributebitmap, entity);
 }
コード例 #12
0
 public void ObjectCreated(int remoteclientreference, string typename, int attributebitmap, byte[] entitydata)
 {
     MetaverseServer.GetInstance().netreplicationcontroller.ObjectCreatedRpcClientToServer(connection,
                                                                                           remoteclientreference, typename, attributebitmap, entitydata);
 }