public void start(StreamLoader streamLoader) { mapIndexData = UnityClient.ReadAllBytes(signlink.findcachedir() + "map_index.dat"); //streamLoader.getDataForName("map_index"); byte[] mapIndexDataNew = UnityClient.ReadAllBytes(signlink.findcachedir() + "map_index.dat"); //streamLoader.getDataForName("map_index"); Stream stream2 = new Stream(mapIndexDataNew); int j1 = stream2.readUnsignedWord(); //mapIndexDataNew.Length / 6; mapIndices1 = new int[j1]; mapIndices2 = new int[j1]; mapIndices3 = new int[j1]; for (int i2 = 0; i2 < j1; i2++) { mapIndices1[i2] = stream2.readUnsignedWord(); mapIndices2[i2] = stream2.readUnsignedWord(); mapIndices3[i2] = stream2.readUnsignedWord(); mapAmount++; } Debug.Log("Map Amount: " + mapAmount + ""); mapIndexDataNew = streamLoader.getDataForName("midi_index"); stream2 = new Stream(mapIndexDataNew); j1 = mapIndexDataNew.Length; anIntArray1348 = new int[j1]; for (int k2 = 0; k2 < j1; k2++) { anIntArray1348[k2] = stream2.readUnsignedByte(); } //clientInstance = client1; running = true; //clientInstance.startRunnable(this, 2); Loom.StartSingleThread(() => { run(); }, System.Threading.ThreadPriority.Normal, true); }
private void Awake() { interactionVolume = gameObject.transform.Find("Interaction Volume").GetComponent <InteractionVolume>(); Client = GameObject.Find("Network").GetComponent <UnityClient>(); Assert.IsNotNull(interactionVolume); objManager = GameObject.Find("Network").GetComponent <NetworkObjectManager>(); }
public CharacterDamageable(IHealthSetter health, CharacterInfo info, UnityClient client, SceneGameplayProperties damageManager) { _health = health; _info = info; _client = client; _damageManager = damageManager; }
void Start() { // Cache components drClient = GetComponent <UnityClient>(); uiManager = UIManager.singleton; networkManager = GetComponent <NetworkManager>(); }
private void Awake() { this.unityClient = FindObjectOfType <UnityClient>(); this.unityClient.MessageReceived += OnMessageReceived; this.turretManager.Init(this.unityClient); }
private void Awake() { base.Awake(); ////////////////// /// Properties initialization clientReference = GetComponent <UnityClient>(); }
public ServerManager( CmdServer server, UnityClient client) { _server = server; _client = client; }
/// <summary> /// Initializes the NetworkManager by: /// Spawning all the components needed. /// Listening to events. /// </summary> public static void Initialize() { Main.Log("Initializing NetworkManager"); isHost = false; isClient = false; if (!UGameObject.Exists("NetworkManager")) { networkManager = Object.Instantiate(new GameObject(), Vector3.zero, Quaternion.identity); networkManager.name = "NetworkManager"; server = networkManager.AddComponent <XmlUnityServer>(); client = networkManager.AddComponent <UnityClient>(); client.Disconnected += OnClientDisconnected; Object.DontDestroyOnLoad(networkManager); server.configuration = new TextAsset(File.ReadAllText("./Mods/DVMultiplayer/Resources/config.xml")); } if (UI == null) { UI = new NetworkingUI(); UI.Setup(); } }
public DeathRequestSender(IDamageable respawnable, UnityClient client, CharacterInfo info) { _damageable = respawnable; _client = client; _info = info; PreInitialize(); }
public HealthUpdateSender(UnityClient client, IDamageable damageable, IHealth health, CharacterInfo info) { _client = client; _damageable = damageable; _health = health; _info = info; }
public LobbyMenuManager( [Inject(Id = Identifiers.LobbyStartGameButton)] Button startGameButton, [Inject(Id = Identifiers.LobbyReadyButton)] Button readyButton, [Inject(Id = Identifiers.LobbyLeaveButton)] Button leaveButton, [Inject(Id = Identifiers.StartTextReady)] Text startTextReady, [Inject(Id = Identifiers.StartTextNotReady)] Text startTextNotReady, UnityClient client, ClientInfo clientInfo, ServerManager serverManager, LobbyMessageSender messageSender, LobbyStateManager lobbyStateManager, HostSceneManager sceneManager, IGameCycleController cycleController) { _readyButton = readyButton; _leaveLobbyButton = leaveButton; _startGameButton = startGameButton; _startTextReady = startTextReady; _startTextNotReady = startTextNotReady; _client = client; _clientInfo = clientInfo; _sceneManager = sceneManager; _cycleController = cycleController; _serverManager = serverManager; _messageSender = messageSender; _lobbyStateManager = lobbyStateManager; }
public void renderWorld() { while (objectsToRender.Count > 0) { RuneObject rune = null; if (objectsToRender.Count > 0) { rune = objectsToRender [0]; } if (rune != null) { rune.RenderMesh(); } if (objectsToRender.Count > 0) { objectsToRender.RemoveAt(0); } } while (objectsToDispose.Count > 0) { GameObject rune = null; if (objectsToDispose.Count > 0) { rune = objectsToDispose [0]; } if (rune != null) { UnityClient.DisposeRuneObject(rune); } if (objectsToDispose.Count > 0) { objectsToDispose.RemoveAt(0); } } }
public ShootCommandSender(UnityClient client, IWeapon weapon, CharacterInfo info) { _client = client; _weapon = weapon; _info = info; PreInitialize(); }
public DisconnectionManager( UnityClient client, GameCycle gameCycle) { _client = client; _gameCycle = gameCycle; }
/* * Loads the sprite data and index files from the cache location. * This can be edited to use an archive such as config or media to load from the cache. * * @param archive */ public static void loadSprites(StreamLoader streamLoader) { //try { RS2Sharp.Stream index = new RS2Sharp.Stream(UnityClient.ReadAllBytes(signlink.findcachedir() + "sprites.idx")); RS2Sharp.Stream data = new RS2Sharp.Stream(UnityClient.ReadAllBytes(signlink.findcachedir() + "sprites.dat")); DataInputStream indexFile = new DataInputStream(new Ionic.Zlib.GZipStream(new MemoryStream(index.buffer), Ionic.Zlib.CompressionMode.Decompress)); DataInputStream dataFile = new DataInputStream(new Ionic.Zlib.GZipStream(new MemoryStream(data.buffer), Ionic.Zlib.CompressionMode.Decompress)); int totalSprites = indexFile.ReadInt(); UnityEngine.Debug.Log("Sprites loaded: " + totalSprites); if (cache == null) { cache = new SpriteLoader[totalSprites]; sprites = new Sprite[totalSprites]; } for (int i = 0; i < totalSprites; i++) { int id = indexFile.ReadInt(); if (cache[id] == null) { cache[id] = new SpriteLoader(); } cache[id].readValues(indexFile, dataFile); createSprite(cache[id]); } //indexFile.Close(); //dataFile.Close(); //} catch (Exception e) { // e.printStackTrace(); //} }
private void Awake() { string rawAddr = IniFile.IniReadValue(IniFile.Sections.Train, IniFile.Keys.Address); System.Net.IPAddress address; if (rawAddr == null) { address = defaultAddress; IniFile.IniWriteValue(IniFile.Sections.Train, IniFile.Keys.Address, address.ToString()); } else { address = System.Net.IPAddress.Parse(rawAddr); } string rawPort = IniFile.IniReadValue(IniFile.Sections.Train, IniFile.Keys.Port); ushort port; if (rawPort == null) { port = defaultPort; IniFile.IniWriteValue(IniFile.Sections.Train, IniFile.Keys.Port, port.ToString()); } else { port = ushort.Parse(rawPort); } //UnityClient client = gameObject.AddComponent(typeof(UnityClient)) as UnityClient; UnityClient client = gameObject.AddComponent <UnityClient>() as UnityClient; client.Address = address; client.Port = port; }
private void Awake() { this.enemies = new Dictionary <uint, ClientEnemyController>(); this.unityClient = FindObjectOfType <UnityClient>(); this.unityClient.MessageReceived += OnMessageReceived; }
public NetworkRelay( UnityClient client) { _client = client; _messageHandlers = new Dictionary <ushort, List <Action <Message> > >(); InitializeMessageHandlers(); }
public EquipmentMessageSender( UnityClient client, CharacterFacade characterFacade ) { _networkManager = client; _characterFacade = characterFacade; }
void Awake() { ////////////////// /// Properties initialization clientReference = GetComponent <UnityClient>(); clientReference.MessageReceived += MessageReceived; }
// Use this for initialization void Start() { trace("Socket started."); client = new UnityClient(); _counter = counterInterval; }
public MouseDetection(UnityClient client1) { syncObject = new Object(); coordsY = new int[500]; running = true; coordsX = new int[500]; clientInstance = client1; }
private static void MainClient() { Client2 coreClient = new Client2("127.0.0.1"); coreClient.SetAsClientSide(); client = new UnityClient(coreClient, 1f); client.clockTicker.isClearOnInternalClock = false; }
static UnityWebRequest generateOrUpdateUnityClient(string projectGuid, string method, UnityClientInfo unityClientInfo, XiaomiSettings xiaomi, string callbackUrl) { // TODO read xiaomi info from user input UnityChannel channel = new UnityChannel(); channel.xiaomi = xiaomi; channel.projectGuid = projectGuid; channel.callbackUrl = callbackUrl; // set necessary client post data UnityClient client = new UnityClient(); client.client_name = projectGuid; client.scopes.Add("identity"); client.channel = channel; string api = null; if (method.Equals(UnityWebRequest.kHttpVerbPOST, StringComparison.InvariantCultureIgnoreCase)) { api = "/v1/oauth2/user-clients"; } else if (method.Equals(UnityWebRequest.kHttpVerbPUT, StringComparison.InvariantCultureIgnoreCase)) { // if client is not generated or loaded, directly ignore update if (unityClientInfo.ClientId == null) { Debug.LogError("Please get/generate Unity Client first."); loaded = false; return(null); } if (updateRev == null) { Debug.LogError("Please get/generate Unity Client first."); loaded = false; return(null); } client.rev = updateRev; if (orgId == null) { Debug.LogError("Please get/generate Unity Client first."); loaded = false; return(null); } client.owner = orgId; client.ownerType = "ORGANIZATION"; api = "/v1/oauth2/user-clients/" + unityClientInfo.ClientId; } else { return(null); } string token = tokenInfo.access_token; return(asyncRequest(method, url, api, token, client)); }
public LobbyMessageSender( UnityClient client, LobbyState lobbyState, SceneMessageSender sceneMessageSender) { _client = client; _lobbyState = lobbyState; _sceneMessageSender = sceneMessageSender; }
private void Awake() { client = GameObject.FindGameObjectWithTag("NetworkManager").GetComponent <UnityClient>(); Assert.IsNotNull(client); mainCameraTransform = GameObject.FindGameObjectWithTag("MainCamera").transform; defaultCollider.enabled = true; holdCollider.enabled = false; }
public WeaponChangedMessageSender( IWeapon weapon, UnityClient unityClient, CharacterFacade characterFacade) { _weapon = weapon; _unityClient = unityClient; _characterFacade = characterFacade; }
// Use this for initialization void Start() { turnInProgress = false; Debug.Log("current player" + UnityClient.currentPlayer + " number of players " + UnityClient.numberOfPlayers); Debug.Log((UnityClient.currentPlayer + 1 % UnityClient.numberOfPlayers)); multiplayerInfo = (UnityClient)GameObject.FindObjectOfType <UnityClient>(); button.SetActive(false); }
/// <summary> /// Sends ushort message to Server /// </summary> /// <param name="txt"></param> /// <param name="tag"></param> public static void SendToServer(ushort number, ushort tag, UnityClient client) { using (DarkRiftWriter writer = DarkRiftWriter.Create()) { writer.Write(number); using (Message playerMessage = Message.Create(tag, writer)) client.SendMessage(playerMessage, SendMode.Reliable); } }
public ConnectionMenuMessageSender( UnityClient client, SceneMessageSender sceneMessageSender, PlayerOptions playerOptions) { _client = client; _sceneMessageSender = sceneMessageSender; _playerOptions = playerOptions; }