Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.3 kB
2
Indexable
Never
else if (actual_command == "/tests") {

PlayerMoving data_{};

		data_.packetType = 27, data_.netID = pInfo(peer)->netID, data_.YSpeed = 44, data_.x = atoi("anan");

		BYTE* raw = packPlayerMoving(&data_);
		for (ENetPeer* currentPeer = server->peers; currentPeer < &server->peers[server->peerCount]; ++currentPeer) {
			if (currentPeer->state != ENET_PEER_STATE_CONNECTED or currentPeer->data == NULL or pInfo(peer)->world != pInfo(currentPeer)->world) continue;
			send_raw(currentPeer, 4, raw, 56, ENET_PACKET_FLAG_RELIABLE);
		}
		delete[] raw;
		
		
		PlayerMoving dats_{};

		dats_.packetType = 28, dats_.netID = pInfo(peer)->netID, dats_.x = pInfo(peer)->x + 16, dats_.y = pInfo(peer)->y + 16;

GameGenerator gg;
        gg.set_label("Classic Deathmatch")
            ->set_team(4)
            ->set_team_list(RED, YELLOW, BLUE, PURPLE)
            ->set_score(0, 0, 0, 0)
            ->set_time(3600);

        gg.write_all();
        
		BYTE* raw = packPlayerMoving(&dats_);
		for (ENetPeer* currentPeer = server->peers; currentPeer < &server->peers[server->peerCount]; ++currentPeer) {
			if (currentPeer->state != ENET_PEER_STATE_CONNECTED or currentPeer->data == NULL or pInfo(peer)->world != pInfo(currentPeer)->world) continue;
			gg.load_all();
			send_raw(currentPeer, 4, raw, 56, ENET_PACKET_FLAG_RELIABLE);
		}
		delete[] raw;

}