mirror of
https://github.com/RPG-Research/bcirpg.git
synced 2024-04-16 14:23:01 +00:00
Worked on a small demo project, to start making a dedicated server.
This commit is contained in:
1
Phase2/Networking/Server/.import/.gdignore
Normal file
1
Phase2/Networking/Server/.import/.gdignore
Normal file
@ -0,0 +1 @@
|
||||
|
@ -0,0 +1,3 @@
|
||||
source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
|
||||
dest_md5="26ea799ea0a3da9e753b3ebe822e0570"
|
||||
|
Binary file not shown.
23
Phase2/Networking/Server/Server/Server.gd
Normal file
23
Phase2/Networking/Server/Server/Server.gd
Normal file
@ -0,0 +1,23 @@
|
||||
extends Node
|
||||
|
||||
var network = NetworkedMultiplayerENet.new()
|
||||
var port = 8080
|
||||
var max_players = 4
|
||||
|
||||
func _ready():
|
||||
start_server()
|
||||
|
||||
func start_server():
|
||||
network.create_server(port, max_players)
|
||||
get_tree().set_network_peer(network)
|
||||
network.connect("peer_connected", self, "_player_connected")
|
||||
network.connect("peer_disconnected", self, "_player_disconnected")
|
||||
|
||||
print("Server Started")
|
||||
|
||||
func _player_connected(player_id):
|
||||
print("Player: " + str(player_id) + " Connected")
|
||||
|
||||
func _player_disconnected(player_id):
|
||||
print("Player: " + str(player_id) + " Disconnected")
|
||||
|
6
Phase2/Networking/Server/Server/Server.tscn
Normal file
6
Phase2/Networking/Server/Server/Server.tscn
Normal file
@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://Server/Server.gd" type="Script" id=1]
|
||||
|
||||
[node name="Server" type="Node"]
|
||||
script = ExtResource( 1 )
|
7
Phase2/Networking/Server/default_env.tres
Normal file
7
Phase2/Networking/Server/default_env.tres
Normal file
@ -0,0 +1,7 @@
|
||||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
[resource]
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
BIN
Phase2/Networking/Server/icon.png
Normal file
BIN
Phase2/Networking/Server/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
35
Phase2/Networking/Server/icon.png.import
Normal file
35
Phase2/Networking/Server/icon.png.import
Normal file
@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.png"
|
||||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
30
Phase2/Networking/Server/project.godot
Normal file
30
Phase2/Networking/Server/project.godot
Normal file
@ -0,0 +1,30 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=4
|
||||
|
||||
[application]
|
||||
|
||||
config/name="ServerDemo"
|
||||
run/main_scene="res://Server/Server.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[gui]
|
||||
|
||||
common/drop_mouse_on_gui_input_disabled=true
|
||||
|
||||
[physics]
|
||||
|
||||
common/enable_pause_aware_picking=true
|
||||
|
||||
[rendering]
|
||||
|
||||
quality/driver/driver_name="GLES2"
|
||||
vram_compression/import_etc=true
|
||||
vram_compression/import_etc2=false
|
||||
environment/default_environment="res://default_env.tres"
|
Reference in New Issue
Block a user