xolatgames

joined 8 months ago
[–] xolatgames@programming.dev 1 points 3 months ago

I changed the IP address from "127.0.0.1" for connection to the server in the configs of the game to the IP adress of the VPS. And in this case the logs from the browser console looks so now:

Blocked loading mixed active content “http://218.14.40.150:777/abilities/active/all%E2%80%9D game.js:9:186044
TypeError: NetworkError when attempting to fetch resource.
    create https://example.com/game.js:9
    _godot_js_fetch_create https://example.com/game.js:9
    callUserCallback https://example.com/game.js:9
    runIter https://example.com/game.js:9
    Browser_mainLoop_runner https://example.com/game.js:9
game.js:474:18
SCRIPT ERROR: Assertion failed. game.js:474:18
   at: HttpHighClient.send_request (res://scripts/common/http/http_high_client.gd:37) game.js:474:18
ERROR: Parse JSON failed. Error at line 0: Unknown error getting token game.js:474:18
   at: parse_string (core/io/json.cpp:582) game.js:474:18
�[91m�[1mERROR: �[22mDB API can't read this response: /abilities/active/all�[39m�[0m game.js:459:16
ERROR: DB API can't read this response: /abilities/active/all game.js:474:18
   at: push_error (core/variant/variant_utility.cpp:1098) game.js:474:18

But the connection still won't works 🤷‍♂️

P.S: Some content from the logs was changed for privacy reason.

[–] xolatgames@programming.dev 1 points 3 months ago

This is a piece of logs from the browser console:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:777/abilities/active/all. (Reason: CORS request did not succeed). Status code: (null).
TypeError: NetworkError when attempting to fetch resource. game.js:474:18
Firefox can’t establish a connection to the server at ws://127.0.0.1:888/. game.js:9:219740
SCRIPT ERROR: Assertion failed. game.js:474:18
   at: HttpHighClient.send_request (res://scripts/common/http/http_high_client.gd:37) game.js:474:18
ERROR: Parse JSON failed. Error at line 0: Unknown error getting token game.js:474:18
   at: parse_string (core/io/json.cpp:582) game.js:474:18
�[91m�[1mERROR: �[22mDB API can't read this response: /abilities/active/all�[39m�[0m game.js:459:16

Firewall I've already checked.

 

Hi, folks! ✌️ How are you? 👋

I'm working on the game that uses WebSocketPeer for multiplaying.

And when I runs the game, WebSocketPeer works as well. Also when I exports the game for Desktop platforms, then launches this, WebSocketPeer works also.

The problems happens when I exports the game for WebGL:

  1. I export the game for WebGL, compress this to a zip archive, then send this archive to the VPS server.

  2. Connect to this VPS server and unzip archive.

From a browser the game works very well, except connection through WebSocketPeer.

For running this game on a browser, I'm using NGINX as a HTTP server.

This game connect to the game server (that developed separately), that also located on the same machine, and also uses WebSocketPeer.

I have try to point the IP address of the VPS server in the configs of the game, and it doesn't works. Also doesn't works to point "127.0.0.1" in the configs of this game.

Folks, where's the problem may be? And what do I do wrong now? 😟

Thanks in advance.

[–] xolatgames@programming.dev -1 points 6 months ago

I think that doesn't respectful to stay in this community for myself. Have a nice day! ✌🏼

[–] xolatgames@programming.dev 1 points 6 months ago

Thanks so much! 👍🏼

[–] xolatgames@programming.dev 1 points 6 months ago

But thanks to you! 😄

[–] xolatgames@programming.dev 1 points 6 months ago

What's the best encryption algorithm in your opinion?

[–] xolatgames@programming.dev 2 points 6 months ago* (last edited 6 months ago) (1 children)

Let's solve the first part then.

But I guess that @herzenschein already suggested me a solution...

You could take inspiration from Theodore Tso’s pwgen: https://github.com/tytso/pwgen

[–] xolatgames@programming.dev -1 points 6 months ago (2 children)

Asking to do a homework.

 

Hi! ✌️ I need to generate some string in C++ with random characters that can use all letters from "a" to "z" (include capital letters), and all numbers from 0 to 9 there.

And for examples this should looks somehow like this:

SnHXAsOC5XDYLgiKM5ly

Also I want to encrypt that string then by itself:

SnHXAsOC5XDYLgiKM5ly encrypt with SnHXAsOC5XDYLgiKM5ly key.

So, how can I do this in C++? 🤔

Thanks in advance!

 

Some objects sticks with each other when those use CharacterBody2D, and moves like those are sticking together.

So, what do I need to do to solve this issue?

9
submitted 8 months ago* (last edited 8 months ago) by xolatgames@programming.dev to c/godot@programming.dev
 

Hi, folks! So, I have the problem with making materials as unique.

Image

I need effects, such as painting of ships in red color, will applies only where particles will spawns. But... As you can see those effects can applies also into other ships.

I've already set these materials as "Local to Scene" into inspector tab.

And have create script for making those materials as unique:

func _make_ship_materials_unique() -> void:
	for i in ship.get_children():
		if i is MeshInstance3D:
			for n in range(i.get_surface_override_material_count()):
				i.mesh.surface_set_material(n, i.mesh.surface_get_material(n).duplicate(true))

But it given me few results 😕

If it can help, here's the script of applying of ships painting:

func damaged_spec_effect() -> void:
	for i in ship.get_children():
		if i is MeshInstance3D:
			for n in range(i.get_surface_override_material_count()):
				_create_fade_in_then_out_effect(i.mesh.surface_get_material(n), Color.RED)
func _create_fade_in_then_out_effect(material: Material, final_color: Color) -> void:
	if material is StandardMaterial3D:
		material.albedo_color = Color.WHITE
		var tween = get_tree().create_tween()
		tween.tween_property(material, "albedo_color", final_color, EFFECTS_DURATION / 2)
		tween.tween_property(material, "albedo_color", Color.WHITE, EFFECTS_DURATION / 2)

So, what do I need to do for solving my problem? 🤔

view more: next ›