Ejemplo n.º 1
0
        /// <summary>
        /// Send level up packet to client and update database
        /// </summary>
        /// <param name="client">The MapClient</param>
        /// <param name="type">The LevelType that gained level(s)</param>
        /// <param name="numLevels">The number of levels gained</param>
        private void SendLevelUp(MapClient client, LevelType type, uint numLevels)
        {
            //Update DB
            Packets.Server.LevelUp sendPacket = new SagaMap.Packets.Server.LevelUp();
            sendPacket.SetLevelType((byte)type);
            sendPacket.SetActorID(client.Char.id);
            sendPacket.SetLevels(1);
            client.netIO.SendPacket(sendPacket, client.SessionID);
            switch (type)
            {
            case LevelType.CLEVEL:
                SagaMap.Skills.SkillHandler.CalcHPSP(ref client.Char);
                client.Char.HP        = client.Char.maxHP;
                client.Char.SP        = client.Char.maxSP;
                client.Char.cLevel   += numLevels;
                client.Char.stpoints += (byte)(2 * numLevels);                          // TODO implement getting this from level configuration
                client.SendBattleStatus();
                client.SendCharStatus(0);
                client.SendExtStats();
                break;

            case LevelType.JLEVEL:
                client.Char.jLevel += numLevels;
                client.Char.HP      = client.Char.maxHP;
                client.Char.SP      = client.Char.maxSP;
                client.SendCharStatus(0);
                break;
            }

            Logger.ShowInfo(client.Char.name + " gained " + numLevels + "x" + type.ToString(), null);

            //if (client.Party != null)
            //    client.Party.UpdateMemberInfo(client);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Check whether input clients experience at the input level type has reached beyond it's current level or not.
        /// If it has, process the new level (update database and inform client), if not, proceed as nothing happened.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="type"></param>
        public void CheckExp(MapClient client, LevelType type)
        {
            switch (type)
            {
            case LevelType.CLEVEL:
                this.lvlDelta = this.GetLevelDelta(client.Char.cLevel, client.Char.cExp, LevelType.CLEVEL, true);
                if (this.lvlDelta > 0)
                {
                    this.SendLevelUp(client, type, this.lvlDelta);
                }
                break;

            case LevelType.JLEVEL:
                this.lvlDelta = this.GetLevelDelta(client.Char.jLevel, client.Char.jExp, LevelType.JLEVEL, true);
                if (this.lvlDelta > 0)
                {
                    this.SendLevelUp(client, type, this.lvlDelta);
                }
                break;

            case LevelType.WLEVEL:
                Weapon weapon = WeaponFactory.GetActiveWeapon(client.Char);
                this.lvlDelta = this.GetLevelDelta(weapon.level, weapon.exp, LevelType.WLEVEL, false);
                if (this.lvlDelta > 0)
                {
                    // Make sure that the wexp don't exceed the maximum
                    weapon.exp = this.Chart[weapon.level].wxp;
                }
                break;
            }
        }
Ejemplo n.º 3
0
        public void ListClients(MapClient sclient)
        {
            string message = "";
            int    i       = 0;

            foreach (Client j in this.clients.Values)
            {
                if (j.GetType() != typeof(MapClient))
                {
                    continue;
                }
                MapClient temp = (MapClient)j;
                if (temp.Char == null)
                {
                    continue;
                }
                message += (temp.Char.name + " ");
                if ((i % 4) == 0 && i != 0)
                {
                    sclient.SendMessage("Saga", message);
                    message = "";
                }
                i++;
            }
            if (message != "")
            {
                sclient.SendMessage("Saga", message);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Connects new clients
        /// </summary>
        public override void NetworkLoop(int maxNewConnections)
        {
            for (int i = 0; listener.Pending() && i < maxNewConnections; i++)
            {
                Socket sock = listener.AcceptSocket();

                Logger.ShowInfo("New client from: " + sock.RemoteEndPoint.ToString(), null);
                uint      sessionid = (uint)((uint)0xFFFFFFFF - clients.Count);
                MapClient client    = new MapClient(sock, this.commandTable, sessionid);
                ClientManager.EnterCriticalArea();
                while (clients.ContainsKey(sessionid))
                {
                    if (sessionid > 0x40000000)
                    {
                        sessionid--;
                    }
                    else
                    {
                        sessionid++;
                    }
                }
                clients.Add(sessionid, client);
                ClientManager.LeaveCriticalArea();
            }
        }
Ejemplo n.º 5
0
        public GameClient(Uri ph_uri, Uri mh_uri, Uri ch_uri)
        {
            client = this;
            // Create game simulation.
            game_sim = new ClientSimulation();
            // Create game state.
            game_state = new ClientState();
            // Create rendering instance
            renderer = new Renderer(320, 240);

            // Create connection Hubs
            player_hub_conn = new HubConnectionBuilder().WithUrl(ph_uri).Build();
            map_hub_conn    = new HubConnectionBuilder().WithUrl(mh_uri).Build();
            chat_hub_conn   = new HubConnectionBuilder().WithUrl(ch_uri).Build();


            player_client = new PlayerClient(player_hub_conn);
            map_client    = new MapClient(map_hub_conn);

            map_client.loadMapFromServer();

            chat_client = new ChatClient(chat_hub_conn);
            //chat_client.onChatUpdated += refreshMessages;

            player_hub_conn.SendAsync("registerPlayerConnection", game_state.player);

            player_hub_conn.SendAsync("getSprites");
            player_hub_conn.SendAsync("getTextures");

            b_is_running = true;

            doGameLoop();
        }
Ejemplo n.º 6
0
 public Regeneration(MapClient client,ushort hp,ushort sp,int period)
 {
     this.dueTime = 1000;
     this.period = period;
     this.client = client;
     this.hp = hp;
     this.sp = sp;
 }
Ejemplo n.º 7
0
 public Regeneration(MapClient client, ushort hp, ushort sp, int period)
 {
     this.dueTime = 1000;
     this.period  = period;
     this.client  = client;
     this.hp      = hp;
     this.sp      = sp;
 }
Ejemplo n.º 8
0
 public MapRemoteDataSource(
     ILogger <MapRemoteDataSource> logger,
     MapClient client
     )
 {
     this.logger = logger;
     this.client = client;
 }
Ejemplo n.º 9
0
        public override void OnClientDisconnect(Client client)
        {
            MapClient client_ = (MapClient)client;

            if (this.clients.ContainsKey(client_.SessionID))
            {
                this.clients.Remove(client_.SessionID);
            }
        }
Ejemplo n.º 10
0
 private byte GetIndexForClient(MapClient c1, MapClient c2)
 {
     /*int index1, index2;
      * index1 = this.Members.IndexOf(c1);
      * index2 = this.Members.IndexOf(c2);
      * if (c1 == c2) return 1;
      * if (index1 < index2) return (byte)(index1 + 2);
      * else return (byte)(index1 + 1);*/
     return(1);
 }
Ejemplo n.º 11
0
        /// <summary>
        /// called the first time a user shows up to the page
        /// </summary>
        /// <param name="message"></param>
        public void Join(MapClient message)
        {
            // add the user to the list of clients
            _clients.Add(this.Context.ConnectionId, message);

            // let all of the clients know a new user is here
            this.Clients.All.addClient(message);

            // tell the caller about the full list
            this.Clients.Caller.addClients(_clients.ToArray());
        }
Ejemplo n.º 12
0
 /// <summary>
 /// Connects new clients
 /// </summary>
 public override void NetworkLoop(int maxNewConnections)
 {
     for (int i = 0; listener.Pending() && i < maxNewConnections; i++)
     {
         Socket sock = listener.AcceptSocket();
         string ip   = sock.RemoteEndPoint.ToString().Substring(0, sock.RemoteEndPoint.ToString().IndexOf(':'));
         Logger.ShowInfo(string.Format(LocalManager.Instance.Strings.NEW_CLIENT, sock.RemoteEndPoint.ToString()), null);
         MapClient client = new MapClient(sock, this.commandTable);
         clients.Add(client);
     }
 }
Ejemplo n.º 13
0
 public void RemoveMember(MapClient client, byte index)
 {
     /*foreach (MapClient c in this.Members)
      * {
      *  if (GetIndexForClient(client, c) == index)
      *  {
      *      RemoveMember(this.Members[index]);
      *      return;
      *  }
      * }*/
     RemoveMember(this.Members[index]);
 }
Ejemplo n.º 14
0
 public void SendLoot(MapClient client, uint id)
 {
     Packets.Server.PartyMemberLoot p = new SagaMap.Packets.Server.PartyMemberLoot();
     p.SetIndex((byte)(this.Members.IndexOf(client) + 1));
     p.SetActorID(client.Char.id);
     p.SetItemID(id);
     foreach (MapClient c in this.Members)
     {
         if (c != client)
         {
             c.netIO.SendPacket(p, c.SessionID);
         }
     }
 }
Ejemplo n.º 15
0
 private void SendPartyInfo(MapClient client)
 {
     Packets.Server.SendPartyInfo p = new SagaMap.Packets.Server.SendPartyInfo();
     p.SetLeaderIndex((byte)(this.Members.IndexOf(this.Leader) + 1));
     p.SetLeader(Leader.Char.id);
     p.SetSetting1((byte)LootShare);
     //p.SetSetting1(LootShare);
     //p.SetSetting2(1);
     p.SetSetting2((byte)XPShare);
     p.SetSetting3(0);
     p.SetSetting4(0);
     p.SetMemberInfo(this.Members);
     client.netIO.SendPacket(p, client.SessionID);
 }
Ejemplo n.º 16
0
        public JsonResult GetElementTypes()
        {
            var mapClient = new MapClient(apiConfig.GetString("ImxApiMediaUrl"), apiConfig.GetString("oAuthConsumerKey"), apiConfig.GetString("oAuthConsumerSecret"), 1);

            var apiElementTypes = mapClient.GetMapElementTypes();
            var elementTypes = new List<ElementType>();

            foreach (var element in apiElementTypes)
            {
                elementTypes.Add(new ElementType(element.ID, element.Name, element.Clear_ImageUrl));
            }

            return Json(elementTypes, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 17
0
 public void UpdateMemberInfo(MapClient client)
 {
     if (!this.Members.Contains(client))
     {
         return;
     }
     Packets.Server.PartyMemberInfo p1 = new SagaMap.Packets.Server.PartyMemberInfo();
     p1.SetIndex(1);
     p1.SetActorID(client.Char.id);
     p1.SetActorInfo(client.Char);
     foreach (MapClient c in this.Members)
     {
         c.netIO.SendPacket(p1, c.SessionID);
     }
 }
Ejemplo n.º 18
0
 public override void Parse(SagaLib.Client client)
 {
     try
     {
         LoginSession client_         = (LoginSession)client;
         Packets.Login.Send.MapPong p = new SagaMap.Packets.Login.Send.MapPong();
         client.netIO.SendPacket(p, client_.SessionID);
     }
     catch
     {
         MapClient client_            = (MapClient)client;
         Packets.Login.Send.MapPong p = new SagaMap.Packets.Login.Send.MapPong();
         client.netIO.SendPacket(p, client_.SessionID);
     }
 }
Ejemplo n.º 19
0
 public void ListClientsAndInfo(MapClient sclient)
 {
     foreach (Client i in this.clients.Values)
     {
         if (i.GetType() != typeof(MapClient))
         {
             continue;
         }
         MapClient client = (MapClient)i;
         if (client.Char == null)
         {
             continue;
         }
         sclient.SendMessage("Saga", "Char: " + client.Char.name + " Map: " + client.Char.mapID + " x:" + client.Char.x + " y:" + client.Char.y + " z:" + client.Char.z);
     }
 }
Ejemplo n.º 20
0
 private void SendNewMemberInfoToOldMember(MapClient client)
 {
     Packets.Server.PartyNewMember p = new SagaMap.Packets.Server.PartyNewMember();
     p.SetIndex(1);
     p.SetActorID(client.Char.id);
     p.SetUnknown(1);
     p.SetName(client.Char.name);
     Packets.Server.PartyMemberInfo p1 = new SagaMap.Packets.Server.PartyMemberInfo();
     p1.SetIndex(1);
     p1.SetActorID(client.Char.id);
     p1.SetActorInfo(client.Char);
     foreach (MapClient c in this.Members)
     {
         c.netIO.SendPacket(p, c.SessionID);
         c.netIO.SendPacket(p1, c.SessionID);
     }
 }
Ejemplo n.º 21
0
 public void SendPosition(MapClient client)
 {
     Packets.Server.PartyMemberPosition p = new SagaMap.Packets.Server.PartyMemberPosition();
     p.SetIndex(1);
     p.SetActorID(client.Char.id);
     p.SetX(client.Char.x / 1000);
     p.SetY(client.Char.y / 1000);
     foreach (MapClient c in this.Members)
     {
         if (c != client)
         {
             if (c.Char.mapID == client.Char.mapID)
             {
                 c.netIO.SendPacket(p, c.SessionID);
             }
         }
     }
 }
Ejemplo n.º 22
0
 public void RemoveMember(MapClient client)
 {
     foreach (MapClient c in this.Members)
     {
         if (c.state == MapClient.SESSION_STATE.LOGGEDOFF)
         {
             continue;
         }
         Packets.Server.PartyMemberQuit p = new SagaMap.Packets.Server.PartyMemberQuit();
         //p.SetIndex(GetIndexForClient(c, client));
         p.SetIndex((byte)(this.Members.IndexOf(client) + 1));
         p.SetUnknown(1);
         p.SetActorID(client.Char.id);
         c.netIO.SendPacket(p, c.SessionID);
     }
     Packets.Server.PartyDismissed tp = new SagaMap.Packets.Server.PartyDismissed();
     if (client.state != MapClient.SESSION_STATE.LOGGEDOFF)
     {
         client.netIO.SendPacket(tp, client.SessionID);
     }
     this.Members.Remove(client);
     client.Party = null;
     if (this.Members.Count == 1)
     {
         Packets.Server.PartyDismissed p = new SagaMap.Packets.Server.PartyDismissed();
         this.Members[0].netIO.SendPacket(p, this.Members[0].SessionID);
         this.Members[0].Party = null;
     }
     else
     {
         if (this.Leader == client)
         {
             this.Leader = this.Members[0];
         }
         foreach (MapClient c in this.Members)
         {
             if (c.state == MapClient.SESSION_STATE.LOGGEDOFF)
             {
                 continue;
             }
             SendPartyInfo(c);
         }
     }
 }
Ejemplo n.º 23
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="settings"></param>
        /// <param name="deviceProfile"></param>
        /// <param name="authenticatedUser"></param>
        public PokemonGoApiClient(IApiSettings settings, IDeviceProfile deviceProfile, AuthenticatedUser authenticatedUser = null) : this()
        {
            StartTime = DateTimeOffset.UtcNow;
            CancellationTokenSource = new CancellationTokenSource();
            RequestQueue            = new BlockingCollection <RequestEnvelope>();

            Player    = new PlayerClient(this);
            Download  = new DownloadClient(this);
            Inventory = new InventoryClient(this);
            Map       = new MapClient(this);
            Fort      = new FortClient(this);
            Encounter = new EncounterClient(this);

            ApiSettings   = settings;
            DeviceProfile = deviceProfile;

            SetAuthenticationProvider();
            AuthenticatedUser = authenticatedUser;
            Player.SetCoordinates(ApiSettings.DefaultPosition.Latitude, ApiSettings.DefaultPosition.Longitude, ApiSettings.DefaultPosition.Accuracy);
        }
Ejemplo n.º 24
0
        public PortMapProcess(MapClient mapClient, Route route, Socket srcSocket, String serverAddress2, int serverPort2, string password_proxy_md5,
                              string dstAddress, int dstPort)
        {
            this.mapClient     = mapClient;
            this.serverAddress = serverAddress2;
            this.serverPort    = serverPort2;

            this.srcSocket          = srcSocket;
            this.password_proxy_md5 = password_proxy_md5;

            try {
                srcIs = new DataInputStream(srcSocket.getInputStream());
                srcOs = new DataOutputStream(srcSocket.getOutputStream());
                conn  = route.getConnection(serverAddress, serverPort, null);
                tis   = conn.uis;
                tos   = conn.uos;

                JSONObject requestJson = new JSONObject();
                requestJson.put("dst_address", dstAddress);
                requestJson.put("dst_port", dstPort);
                requestJson.put("password_proxy_md5", password_proxy_md5);
                byte[] requestData = requestJson.toJSONString().getBytes("utf-8");
                tos.write(requestData, 0, requestData.length);


                final Pipe p1 = new Pipe();
                final Pipe p2 = new Pipe();


                byte[] responeData = tis.read2();

                String     hs          = new String(responeData, "utf-8");
                JSONObject responeJSon = JSONObject.parseObject(hs);
                int        code        = responeJSon.getIntValue("code");
                String     message     = responeJSon.getString("message");
                String     uimessage   = "";
                if (code == Constant.code_success)
                {
                    Route.es.execute(new Runnable()
                    {
                        @Override
Ejemplo n.º 25
0
 public void AddMember(MapClient client)
 {
     if (this.Members.Count != 0)
     {
         if (this.Members.Count >= 2)
         {
             SendNewMemberInfoToOldMember(client);
             this.Members.Add(client);
         }
         else
         {
             this.Members.Add(client);
             SendPartyInfo(this.Members[0]);
         }
         SendPartyInfo(client);
     }
     else
     {
         this.Members.Add(client);
     }
 }
Ejemplo n.º 26
0
        public GameClient(GameConnection connection, MapConnection mapConnection)
        {
            _mapClient = new MapClient(mapConnection);
            _mapClient.ConnectionOpened += MapClient_ConnectionOpened;
            _mapClient.ConnectionClosed += MapClient_ConnectionClosed;
            _mapClient.ConnectionFailed += MapClient_ConnectionFailed;
            _mapClient.MapLoaded += MapClient_MapLoaded;

            _connection = connection;
            _connection.PacketReceived += OnPacketReceived;
            _connection.Connected += OnConnectionOpened;
            _connection.Disconnected += OnConnectionClosed;

            Rand = new Random();
            I18n = new Language();
            Team = new List<Pokemon>();
            CurrentPCBox = new List<Pokemon>();
            Items = new List<InventoryItem>();
            Channels = new List<ChatChannel>();
            Conversations = new List<string>();
            Players = new Dictionary<string, PlayerInfos>();
            PCGreatestUid = -1;
            IsPrivateMessageOn = true;
        }
Ejemplo n.º 27
0
 public AutoSave(MapClient client)
 {
     this.dueTime = 1000;
     this.period  = 1800000;
     this.client  = client;
 }
Ejemplo n.º 28
0
 public void ListClients(MapClient sclient)
 {
     string message = "";
     int i = 0;
     foreach (Client j in this.clients.Values)
     {
         if (j.GetType() != typeof(MapClient)) continue;
         MapClient temp = (MapClient)j;
         if (temp.Char == null) continue;
         message += (temp.Char.name + " ");
         if ((i % 4) == 0 && i != 0)
         {
             sclient.SendMessage("Saga", message);
             message = "";
         }
         i++;
     }
     if(message != "")
         sclient.SendMessage("Saga", message);
 }       
Ejemplo n.º 29
0
        /// <summary>
        /// Connects new clients
        /// </summary>
        public override void NetworkLoop(int maxNewConnections)
        {
            for (int i = 0; listener.Pending() && i < maxNewConnections; i++)
            {
                Socket sock = listener.AcceptSocket();

                Logger.ShowInfo("New client from: " + sock.RemoteEndPoint.ToString(), null);
                uint sessionid = (uint)((uint)0xFFFFFFFF - clients.Count);
                MapClient client = new MapClient(sock, this.commandTable, sessionid);
                ClientManager.EnterCriticalArea();
                while (clients.ContainsKey(sessionid))
                {
                    if (sessionid > 0x40000000)
                        sessionid--;
                    else
                        sessionid++;
                }
                clients.Add(sessionid, client);
                ClientManager.LeaveCriticalArea();
            }
        }
Ejemplo n.º 30
0
        public void ReloadScript(MapClient client)
        {
            //Get all NPCs
            List <string> tmp2 = new List <string>();

            foreach (string i in this.scripts.Keys)
            {
                Npc npc = this.scripts[i];
                if (npc.isItem == false)
                {
                    if (npc.Actor.npcType < 10000 || npc.Actor.npcType > 50000)
                    {
                        tmp2.Add(i);
                        npc.Map.DeleteActor(npc.Actor);
                    }
                }
                else
                {
                    MapItem item = (MapItem)npc;
                    item.Map.DeleteActor(item.ActorI);
                    tmp2.Add(i);
                }
            }
            foreach (string i in tmp2)
            {
                this.scripts[i].Dispose();
                this.scripts.Remove(i);
            }

            Quest.QuestsManager.QuestItem    = new Dictionary <uint, Dictionary <uint, List <SagaMap.Quest.QuestsManager.questI> > >();
            Quest.QuestsManager.MobQuestItem = new Dictionary <uint, List <SagaMap.Quest.QuestsManager.LootInfo> >();
            Quest.QuestsManager.Enemys       = new Dictionary <uint, Dictionary <uint, List <SagaMap.Quest.QuestsManager.EnemyInfo> > >();
            Quest.QuestsManager.WayPoints    = new Dictionary <uint, Dictionary <uint, List <SagaMap.Quest.QuestsManager.WayPointInfo> > >();
            Logger.ShowInfo("Loading uncompiled scripts", null);
            CSharpCodeProvider provider = new CSharpCodeProvider();
            int npccount     = 0;
            int mapitemcount = 0;

            try
            {
                try
                {
                    Assembly newAssembly = CompileScript(Directory.GetFiles("scripts/npcs", "*.cs", SearchOption.AllDirectories), provider, client);
                    int[]    tmp;
                    if (newAssembly != null)
                    {
                        tmp           = LoadAssembly(newAssembly);
                        mapitemcount += tmp[0];
                        npccount     += tmp[1];
                    }
                }
                catch (Exception ex)
                {
                    Logger.ShowError(ex, null);
                }
            }
            catch (Exception) { }
            Logger.ShowInfo("Loading compiled scripts", null);
            try
            {
                foreach (string s in Directory.GetFiles("cscripts"))
                {
                    try
                    {
                        int[]    tmp;
                        Assembly newAssembly = Assembly.LoadFrom(s);
                        tmp           = LoadAssembly(newAssembly);
                        mapitemcount += tmp[0];
                        npccount     += tmp[1];
                    }
                    catch (Exception) { }
                }
            }
            catch (Exception) { }
            Logger.ShowInfo(string.Format("Reloaded {0} NPCs and {1} MapItems", npccount, mapitemcount), null);
        }
Ejemplo n.º 31
0
 public PCEventHandler(MapClient client)
 {
     Client = client;
 }
Ejemplo n.º 32
0
 public PC_EventHandler(ActorPC actor, MapClient client)
 {
     this.I = actor;
     this.C = client;
 }
Ejemplo n.º 33
0
 public OxygenUsage(MapClient client)
 {
     this.dueTime = 1;
     this.period  = 1000;
     this.client  = client;
 }
Ejemplo n.º 34
0
 public LPReduction(MapClient client)
 {
     this.dueTime = 1000;
     this.period = 10000;
     this.client = client;
 }
Ejemplo n.º 35
0
 public CheckHeartbeat(MapClient client)
 {
     this.dueTime = 1000;
     this.period = 10000;
     this.client = client;
 }
Ejemplo n.º 36
0
        public static Assembly CompileScript(string[] Source, CodeDomProvider Provider, MapClient client)
        {
            //ICodeCompiler compiler = Provider.;
            CompilerParameters parms = new CompilerParameters();
            CompilerResults    results;

            // Configure parameters
            parms.CompilerOptions         = "/target:library /optimize";
            parms.GenerateExecutable      = false;
            parms.GenerateInMemory        = true;
            parms.IncludeDebugInformation = true;
            parms.ReferencedAssemblies.Add("System.dll");
            parms.ReferencedAssemblies.Add("SagaLib.dll");
            parms.ReferencedAssemblies.Add("SagaDB.dll");
            parms.ReferencedAssemblies.Add("SagaMap.exe");
            // Compile
            results = Provider.CompileAssemblyFromFile(parms, Source);
            if (results.Errors.Count > 0)
            {
                foreach (CompilerError error in results.Errors)
                {
                    if (client != null)
                    {
                        client.SendMessage("Saga", "Compile Error:" + error.ErrorText);
                        client.SendMessage("Saga", "File:" + error.FileName + ":" + error.Line);
                    }
                    Logger.ShowError("Compile Error:" + error.ErrorText, null);
                    Logger.ShowError("File:" + error.FileName + ":" + error.Line, null);
                }
                return(null);
            }
            //get a hold of the actual assembly that was generated
            return(results.CompiledAssembly);
        }
Ejemplo n.º 37
0
 public void ListClientsAndInfo(MapClient sclient)
 {
     foreach (Client i in this.clients.Values)
     {
         if (i.GetType() != typeof(MapClient)) continue;
         MapClient client = (MapClient)i;
         if (client.Char == null) continue;
         sclient.SendMessage("Saga", "Char: " + client.Char.name + " Map: " + client.Char.mapID + " x:" + client.Char.x + " y:" + client.Char.y + " z:" + client.Char.z);
     }
 }
Ejemplo n.º 38
0
 public ActionResult GetMapById(int mapIdFrom)
 {
     var mapClient = new MapClient(apiConfig.GetString("ImxApiMediaUrl"), apiConfig.GetString("oAuthConsumerKey"), apiConfig.GetString("oAuthConsumerSecret"), 1);
     ImxMap mapInfo = mapClient.GetMap(mapIdFrom);
     return Json(mapInfo, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 39
0
 public PC_EventHandler(ActorPC actor, MapClient client)
 {
     this.I = actor;
     this.C = client;
 }
Ejemplo n.º 40
0
 public OxygenUsage(MapClient client)
 {
     this.dueTime = 1;
     this.period = 1000;
     this.client = client;
 }
Ejemplo n.º 41
0
 public CheckHeartbeat(MapClient client)
 {
     this.dueTime = 1000;
     this.period  = 10000;
     this.client  = client;
 }
Ejemplo n.º 42
0
        public override void Parse(SagaLib.Client client)
        {
            MapClient cli = (MapClient)client;

            cli.OnSupplySelect(this);
        }
Ejemplo n.º 43
0
 public AutoSave(MapClient client)
 {
     this.dueTime = 1000;
     this.period = 1800000;
     this.client = client;
 }
Ejemplo n.º 44
0
 /// <summary>
 /// Connects new clients
 /// </summary>
 public override void NetworkLoop(int maxNewConnections)
 {
     for (int i = 0; listener.Pending() && i < maxNewConnections; i++)
     {
         Socket sock = listener.AcceptSocket();
         string ip = sock.RemoteEndPoint.ToString().Substring(0, sock.RemoteEndPoint.ToString().IndexOf(':'));
         Logger.ShowInfo(string.Format(LocalManager.Instance.Strings.NEW_CLIENT, sock.RemoteEndPoint.ToString()), null);
         MapClient client = new MapClient(sock, this.commandTable);
         clients.Add(client);
     }
 }