Search found 10 matches

by thinhtd21091
30 Sep 2024, 05:58
Forum: SFS2X Questions
Topic: Are there any other ways to import JavaScript files into an extension besides using include()?
Replies: 1
Views: 1526

Are there any other ways to import JavaScript files into an extension besides using include()?

In the documentation, I read that they use include to import JavaScript files into the extension. Besides include, are there any other ways to do this? And why does "include()" work in JavaScript? Is it a custom syntax specific to SmartFoxServer2X?

Reference Link: https://docs2x.smartfoxserver.com/Exten ... nt#modules
by thinhtd21091
10 Sep 2024, 06:13
Forum: SFS2X Questions
Topic: Is there a way to use variables for zones?
Replies: 1
Views: 1376

Is there a way to use variables for zones?

I'm currently looking for a way to use global variables for a zone, but the documentation only mentions buddy, user, and room variables. Can you guide me?
by thinhtd21091
28 Aug 2024, 07:06
Forum: SFS2X Questions
Topic: The function getRoomListFromGroup is not working
Replies: 2
Views: 1464

Re: The function getRoomListFromGroup is not working

Hi Labo, I have two issues:
1. When I send a group chat using ModeratorMessageRequest as shown below, I get a log message saying "java.lang.IllegalStateException: Mod Message discarded. No recipients," but using AdminMessageRequest works fine.
function onSendGroupMessageBtClick() {
var recipMode ...
by thinhtd21091
28 Aug 2024, 03:22
Forum: SFS2X Questions
Topic: The function getRoomListFromGroup is not working
Replies: 2
Views: 1464

The function getRoomListFromGroup is not working

function populateRoomsList() {
let roomsRaw = sfs.roomManager.getRoomListFromGroup("group_1");
let roomList = [];

console.log(roomsRaw)
for (let r in roomsRaw) {
let room = roomsRaw[r];
roomList.push(`
<a href="#" onclick="onRoomSelected({ id&#58; ${room&#46 ...
by thinhtd21091
27 Aug 2024, 03:41
Forum: SFS2X Questions
Topic: Handling onConnection on the server?
Replies: 1
Views: 824

Handling onConnection on the server?

Is there any way to handle the onConnection event on the server? Currently, I've only found and read documentation that guides this on the client side. If there are any documents available, please provide me with a link. Thanks bro
by thinhtd21091
26 Aug 2024, 10:19
Forum: SFS2X Questions
Topic: How does the checkSecurePassword function and hashing work?
Replies: 4
Views: 1277

Re: How does the checkSecurePassword function and hashing work?

My passwords in the database are hashed. When the client sends the password, I take the 'LOGIN_PASSWORD' parameter, which is already hashed by default, and then I store it in the database. However, when I retrieve it and use the 'checkSecurePassword' function, an error occurs. I don't understand why ...
by thinhtd21091
26 Aug 2024, 06:37
Forum: SFS2X Questions
Topic: How does the checkSecurePassword function and hashing work?
Replies: 4
Views: 1277

How does the checkSecurePassword function and hashing work?

function onUserLogin(evtParams) {
var connection = dbMan&#46;getConnection();
var username = evtParams&#46;getParameter(SFSEventParam&#46;LOGIN_NAME);
var loginPass = evtParams&#46;getParameter(SFSEventParam&#46;LOGIN_PASSWORD);
var getByUserStmt = connection&#46;prepareStatement("SELECT ...
by thinhtd21091
23 Aug 2024, 06:42
Forum: SFS2X Questions
Topic: How to connect multiple databases in SmartFoxServer 2X
Replies: 3
Views: 1199

Re: How to connect multiple databases in SmartFoxServer 2X

Hi bro, can I connect to a NoSQL database (such as MongoDB)? Is there anything different?
by thinhtd21091
23 Aug 2024, 02:59
Forum: SFS2X Questions
Topic: How to connect multiple databases in SmartFoxServer 2X
Replies: 3
Views: 1199

How to connect multiple databases in SmartFoxServer 2X

I am trying to learn how to connect multiple databases in a SmartFoxServer 2X JavaScript extension but can't find any documentation. Can you help me?