コード例 #1
0
 public PerFrameRenderer(Client client)
 {
     this.client = client;
     font = new GTA.Font("Segoe UI", widthToPx(20.0f), FontScaling.Pixel);
     font_small = new GTA.Font("Segoe UI", widthToPx(10.0f), FontScaling.Pixel);
     font_consolas = new GTA.Font("Consolas", widthToPx(20.0f), FontScaling.Pixel);
     client.PerFrameDrawing += Client_PerFrameDrawing;
 }
コード例 #2
0
 public KeyboardHandler(Client client)
 {
     this.client = client;
     keyboardUS = new KeyboardLayoutUS();
     inKeyboardTypingMode = false;
     commandHistory = new List<string>();
     client.KeyDown += new GTA.KeyEventHandler(this.eventOnKeyDown);
     client.KeyUp += new GTA.KeyEventHandler(this.eventOnKeyUp);
 }
コード例 #3
0
 public ChatController(Client client)
 {
     this.client = client;
     currentTypedText = "";
     chatconsole = new Queue<string>();
     debugconsole = new Queue<string>();
     writeChat("Warning: This is alpha software.");
     writeChat("MIV 0.1 - Press L to connect.");
 }
コード例 #4
0
 public PedStreamer(Client client, float range)
     : base(client, range)
 {
     nickfont = new Font("Segoe UI", 24, FontScaling.Pixel, false, false);
     nickfont.Effect = FontEffect.None;
     nickcolor = System.Drawing.Color.LightYellow;
     chatcolor = System.Drawing.Color.White;
     DrawDistance = 120.0f;
     checkLOS = true;
     //fa_font = new Font("FotntAwesome", 24, FontScaling.Pixel, false, false);
 }
コード例 #5
0
 public ServerConnection(Client client)
 {
     internal_buffer = new List<byte>();
     this.client = client;
     buffer = new byte[BUFSIZE];
     playersdata = new Dictionary<uint, UpdateDataStruct>();
     client.client.SendBufferSize = BUFSIZE;
     client.client.Client.ReceiveBufferSize = BUFSIZE;
     client.client.Client.Blocking = true;
     client.client.NoDelay = true;
     client.client.Client.DontFragment = true;
     client.client.Client.NoDelay = true;
     client.client.Client.Blocking = true;
     client.client.Client.ReceiveBufferSize = BUFSIZE;
     client.client.Client.SendBufferSize = BUFSIZE;
     client.client.Client.BeginReceive(buffer, 0, buffer.Length, SocketFlags.None, onReceive, null);
 }
コード例 #6
0
 public StreamerBase(Client client, float streamDistance)
 {
     instances = new List<StreamedObjectBase>();
     this.client = client;
     this.streamDistance = streamDistance;
 }
コード例 #7
0
        private void initAndConnect(string ip, short port, string nickname)
        {
            currentIP = ip;
            GTA.Native.Function.Call("DISABLE_PAUSE_MENU", 1);
            GTA.Native.Function.Call("SET_FILTER_MENU_ON", 1);
            BroadcastingPaused = true;
            playerNames = new Dictionary<uint, string>();
            playerModels = new Dictionary<uint, string>();
            isCurrentlyDead = false;
            actionQueue = new Queue<Action>();
            instance = this;

            jsEngine = new JavaScriptEngine();

            CurrentVirtualWorld = 0;

            cameraController = new CameraController(this);

            debugDraw = new ClientTextView(new System.Drawing.PointF(10, 400), "", new GTA.Font("Segoe UI", 24, FontScaling.Pixel), System.Drawing.Color.White);

            pedStreamer = new PedStreamer(this, 100.0f);
            vehicleStreamer = new VehicleStreamer(this, 100.0f);

            pedController = new PlayerPedController();
            npcPedController = new NPCPedController();
            vehicleController = new VehicleController();
            playerVehicleController = new PlayerVehicleController();
            chatController = new ChatController(this);
            keyboardHandler = new KeyboardHandler(this);
            currentState = ClientState.Initializing;
            Interval = 80;
            //cam = new Camera();
            //cam.Activate();
            currentState = ClientState.Disconnected;
            System.IO.File.WriteAllText("multiv-log.txt", "");
            perFrameRenderer = new PerFrameRenderer(this);

            Player.Character.CurrentRoom = Room.FromString("R_00000000_00000000");

            startTimersandBindEvents();
            try
            {
                if (client != null && client.Connected)
                {
                    client.Close();
                }
                client = new TcpClient();
                IPAddress address = IPAddress.Parse(ip);
                nick = nickname;

                client.Connect(address, port);

                Client.currentData = UpdateDataStruct.Zero;

                serverConnection = new ServerConnection(this);

                World.CurrentDayTime = new TimeSpan(12, 00, 00);
                World.PedDensity = 0;
                World.CarDensity = 0;
                // AlternateHook.call(AlternateHook.OtherCommands.TERMINATE_ALL_SCRIPTS_FOR_NETWORK_GAME);
                GTA.Native.Function.Call("CLEAR_AREA", 0.0f, 0.0f, 0.0f, 4000.0f, true);
                currentState = ClientState.Connecting;
            }
            catch
            {
                currentState = ClientState.Disconnected;
                if (client != null && client.Connected)
                {
                    client.Close();
                }
                throw;
            }
        }
コード例 #8
0
 public VehicleStreamer(Client client, float range)
     : base(client, range)
 {
 }
コード例 #9
0
 public CameraController(Client client)
 {
     this.client = client;
 }