Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clientside game.IsDedicated() always returns false #1495

Closed
EstevanTH opened this issue Sep 13, 2014 · 9 comments
Closed

Clientside game.IsDedicated() always returns false #1495

EstevanTH opened this issue Sep 13, 2014 · 9 comments
Labels
Bug The issue is confirmed to be a bug and not intentional behaviour.

Comments

@EstevanTH
Copy link

Hello,

The function game.IsDedicated() always returns false when used clientside.
On the Wiki, the given information is that this function can be used both clientside and serverside.

game.IsDedicated() on Garry's Mod Wiki

@robotboy655 robotboy655 added the Bug The issue is confirmed to be a bug and not intentional behaviour. label Jan 1, 2015
@fruitwasp
Copy link

bump?

@robotboy655
Copy link
Contributor

As far as I can tell the client has no way of knowing whether a server is dedicated or not, which is why the Lua binding is made to always return false on client.

@Kefta
Copy link
Contributor

Kefta commented Mar 13, 2017

Maybe network the server type on connect? Don't know how useful that info would actually be.

@Bo98
Copy link

Bo98 commented Mar 13, 2017

I think CS:GO has something similar for its net_graph. Possibly is just networked on connect.

@EstevanTH
Copy link
Author

Then it's not a bug and the issue can be closed. 😄

@pparadoxx
Copy link

Maybe network the server type on connect? Don't know how useful that info would actually be.

useful when using system.GetCountry()

@PrikolMen
Copy link

Dear Rubat, this will be fixed?

@robotboy655 robotboy655 added the Net compat This issue requires breaking network compatibility to solve so it will be queued. label Jul 10, 2023
@RaphaelIT7
Copy link

RaphaelIT7 commented Jul 28, 2023

The client fires the server_spawn gameevent when he joins the server.
The client also receives whether the server is dedicated. Maybe the value could be saved and returned until the client leaves the server.

It could also be bound to the SVC_ServerInfo net message, which receives all the data that the server_spawn gameevent uses.

If it would be done in one of these ways, this change wouldn't need any additional networking and could be done any time.

Example of the server_spawn gameevent:
(joining a local game)

address = loopback
dedicated = false
game = garrysmod
hostname = Garry's Mod
ip = 0
mapname = gm_flatgrass
maxplayers = 8
os = W
password = false
port = 0

(joining a dedicated server)

----server_spawn----
address = 168.119.138.3
dedicated = true
game = garrysmod
hostname = Raphael's testing server
ip = 59406248
mapname = gm_flatgrass
maxplayers = 128
os = L
password = false
port = 29015
----------------------

@robotboy655
Copy link
Contributor

Well spotted, made it shared.

@robotboy655 robotboy655 removed the Net compat This issue requires breaking network compatibility to solve so it will be queued. label Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug The issue is confirmed to be a bug and not intentional behaviour.
Projects
None yet
Development

No branches or pull requests

8 participants